<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/jsp/public/common.jspf" %>
<html>
<head>
    <title>个人设置</title>
    <!--validateion-->
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/scripts/jquery_validate/jquery.validate.min.js"></script>
    <script type="text/javascript">
        //validate
        $(document).ready(function () {
            $('form').validate({
                rules: {
                    name: {
                        required: true,
                        maxlength: 255
                    },
                    department: {
                        required: true,
                        maxlength: 255
                    },
                    email: {
                        required: true,
                        maxlength: 255,
                        email: true
                    },
                    password: {
                        minlength: 6,
                        maxlength: 255
                    },
                    confirmPwd: {
                        minlength: 6,
                        maxlength: 255
                    }
                },
                messages: {
                    name: {
                        required: '请填写姓名',
                        maxlength: '姓名长度不超过255字符'
                    },
                    department: {
                        required: '请填写部门',
                        maxlength: '部门长度不超过255字符'
                    },
                    email: {
                        required: '请填写邮箱',
                        maxlength: '邮箱长度不超过255字符',
                        email: '不符合邮箱格式'
                    },
                    password: {
                        minlength: '密码长度在6-255字符',
                        maxlength: '密码长度在6-255字符'
                    },
                    confirmPwd: {
                        minlength: '密码长度在6-255字符',
                        maxlength: '密码长度在6-255字符'
                    }
                }
            });
        });
    </script>
</head>
<body>
<div class="col-sm-9">
    <div class="row">
        <div class="col-lg-12">
            <div class="page-header">
                <h1>个人设置</h1>
            </div>
            <%@ include file="/WEB-INF/jsp/public/pageinfo.jspf" %>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <div class="bootstrap-admin-no-table-panel-content">
                <div class="panel panel-default bootstrap-admin-no-table-panel ">
                    <div class="panel-heading">
                        <div class="text-muted bootstrap-admin-box-title">偏好设置</div>
                    </div>
                    <div class="bootstrap-admin-no-table-panel-content bootstrap-admin-panel-content collapse in">
                        <s:form cssClass="form-horizontal" action="user_editProfile">
                            <fieldset>
                                <legend>修改个人信息</legend>
                                <div class="form-group">
                                    <label class="col-lg-2 control-label">姓名</label>

                                    <div class="col-lg-10">
                                        <s:textfield cssClass="form-control" name="name"/>
                                        <s:fielderror fieldName="name"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-2 control-label">所在部门</label>

                                    <div class="col-lg-10">
                                        <s:textfield cssClass="form-control" name="department"/>
                                        <s:fielderror fieldName="department"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-2 control-label">邮箱</label>

                                    <div class="col-lg-10">
                                        <s:textfield cssClass="form-control" name="email"/>
                                        <s:fielderror fieldName="email"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-2 control-label">新密码</label>

                                    <div class="col-lg-10">
                                        <s:password cssClass="form-control" name="password"/>
                                        <s:fielderror fieldName="password"/>
                                        <small>密码可以不填写，此时表示不修改密码</small>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-2 control-label">重复密码</label>

                                    <div class="col-lg-10">
                                        <s:password cssClass="form-control" name="confirmPassword"/>
                                        <s:fielderror fieldName="confirmPassword"/>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-10 col-lg-offset-2">
                                        <button type="submit" class="btn btn-primary">保存</button>
                                    </div>
                                </div>
                            </fieldset>
                        </s:form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
